package org.demo.mainframe.fx.util;

import java.io.FileInputStream;

import org.demo.mainframe.fx.NMSConstants;

import javafx.scene.image.Image;
import javafx.scene.image.ImageView;

public class ImageUitl {
	
	public static Image loadImage(String img){
		try {
			FileInputStream fis = new FileInputStream(img);
			Image icon = new Image(fis);
			fis.close();
			return icon;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}
	
	public static ImageView loadImageNode(String img){
		try {
			FileInputStream fis = new FileInputStream(img);
			Image icon = new Image(fis);
			fis.close();
			return new ImageView(icon);
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}
}
